package org.zeapp.opencloud.framework.chunking;

import java.io.File;

/**
 * This interface must be implemented by a Chunking service. This service are
 * used to split a file in several chunks.
 * 
 * @author Amphiprion
 * 
 */
public interface Chunking {

	/**
	 * Parse the given file. Each time a chunk is found, the
	 * listener.ChunkFound() method will be called.
	 * 
	 * @param file
	 *            the file to parse
	 * @param listener
	 *            callback for all chunking event
	 * @throws ChunkingException
	 *             if a ChunkingException occurs.
	 */
	void parse(File file, ChunkListener listener) throws ChunkingException;
}
